﻿package dut.ir.lxb.weibo.bean;

import dut.ir.lxb.weibo.util.SpiderConfig;

/**
 * 个人信息
 * @author Baogege
 *
 */
public class UserBean
{
	protected String nickName = "";
	
	protected String uid = "";
	
	protected boolean isMember = false;
	
	protected boolean isApproved = false;
	
	protected String headPicture = "";
	
	protected int level = 0;
	
	protected String approveInfo = "";
	
	protected int fans = 0;
	
	protected int follow = 0;
	
	protected int weibo = 0;
	
	protected String location = "";
	
	protected String sex = "";
	
	protected String sexOrientation = "";
	
	protected String maritalStatus = "";
	
	protected String birth = "";
	
	protected String bloodType = "";
	
	protected String blog = "";
	
	protected String site = "";
	
	protected String introduction = "";
	
	protected String createTime = "";
	
	protected String email = "";
	
	protected String qq = "";
	
	protected String msn = "";
	
	protected String company = "";
	
	protected String educationInfo = "";
	
	protected String tags = "";
	
	protected boolean isOfficial = false;

	public String getNickName()
	{
	
		return nickName;
	}
	
	public String toCSVFormat()
	{
		StringBuilder sb = new StringBuilder();
		sb.append(String.format("\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"", uid, nickName, headPicture, approveInfo, location, sex, sexOrientation, maritalStatus));
		sb.append(String.format(",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"", birth, bloodType, blog, site, introduction, createTime,email, qq, msn, company, educationInfo));
		sb.append(String.format(",%d,%d,%d", fans, follow, weibo));
		
		return sb.toString();
	}
	
	public static String getHeader()
	{
		return "uid,nickname,headpicture,approveinfo,location,sex,sexorientation,maritalstatus,birth,bloodtpye,blog,site,introduction,createtime,email.qq,company,educationinfo,fans,follow,weibo";
		
	}

	public void setNickName(String nickName)
	{
		if(nickName == null)
			nickName = "";
	
		this.nickName = nickName;
	}

	public String getUid()
	{
	
		return uid;
	}

	public void setUid(String uid)
	{
		if(uid == null)
			uid = "";
		this.uid = uid;
	}

	public boolean isMember()
	{
	
		return isMember;
	}

	public void setMember(boolean isMember)
	{
	
		this.isMember = isMember;
	}

	public boolean isApproved()
	{
	
		return isApproved;
	}

	public void setApproved(boolean isApproved)
	{
	
		this.isApproved = isApproved;
	}

	public String getApproveInfo()
	{
	
		return approveInfo;
	}

	public void setApproveInfo(String approveInfo)
	{
		if(approveInfo == null)
			approveInfo = "";
	
		this.approveInfo = approveInfo;
	}

	public String getEducationInfo()
	{
	
		return educationInfo;
	}

	public void setEducationInfo(String educationInfo)
	{
	
		this.educationInfo = educationInfo;
	}

	public int getFans()
	{
	
		return fans;
	}

	public void setFans(int fans)
	{
	
		this.fans = fans;
	}

	public int getFollow()
	{
	
		return follow;
	}

	public void setFollow(int follow)
	{
	
		this.follow = follow;
	}

	public int getWeibo()
	{
	
		return weibo;
	}

	public void setWeibo(int weibo)
	{
	
		this.weibo = weibo;
	}

	public String getLocation()
	{
	
		return location;
	}

	public void setLocation(String location)
	{
		if(location == null)
			location = "";
	
		this.location = location;
	}

	public String getSex()
	{
	
		return sex;
	}

	public void setSex(String sex)
	{
		if(sex == null)
			sex = "";
	
		this.sex = sex;
	}

	public String getSexOrientation()
	{
	
		return sexOrientation;
	}

	public void setSexOrientation(String sexOrientation)
	{
		if(sexOrientation == null)
			sexOrientation = "";;
	
		this.sexOrientation = sexOrientation;
	}

	public String getMaritalStatus()
	{
	
		return maritalStatus;
	}

	public void setMaritalStatus(String maritalStatus)
	{
		if(maritalStatus == null)
			maritalStatus = "";
	
		this.maritalStatus = maritalStatus;
	}

	public String getBirth()
	{
	
		return birth;
	}

	public void setBirth(String birth)
	{
		if(birth == null)
			birth = "";
	
		this.birth = birth;
	}

	public String getBloodType()
	{
	
		return bloodType;
	}

	public void setBloodType(String bloodType)
	{
		if(bloodType == null)
			bloodType = "";
	
		this.bloodType = bloodType;
	}

	public String getBlog()
	{
	
		return blog;
	}

	public void setBlog(String blog)
	{
		if(blog == null)
			blog = "";
	
		this.blog = blog;
	}

	public String getSite()
	{
	
		return site;
	}

	public void setSite(String site)
	{
		if(site == null)
			site = "";
		if(site.contains("|"))
			site = site.substring(site.indexOf('|') + 1);
		if(site.length() > 50)
			site = site.substring(0, 50);
		this.site = site;
	}

	public String getIntroduction()
	{
	
		return introduction.replace(SpiderConfig.emojPattern, "");
	}

	public void setIntroduction(String introduction)
	{
		if(introduction == null)
			introduction = "";
	
		this.introduction = introduction.replace(SpiderConfig.emojPattern, "");
	}

	public String getCreateTime()
	{
	
		return createTime;
	}

	public void setCreateTime(String createTime)
	{
		if(createTime == null)
			createTime = "";
	
		this.createTime = createTime;
	}

	public String getEmail()
	{
	
		return email;
	}

	public void setEmail(String email)
	{
		if(email == null)
			email = "";
	
		this.email = email;
	}

	public String getQq()
	{
	
		return qq;
	}

	public void setQq(String qq)
	{
		if(qq == null)
			qq = "";
	
		this.qq = qq;
	}

	public String getMsn()
	{
	
		return msn;
	}

	public void setMsn(String msn)
	{
		if(msn == null)
			msn = "";
	
		this.msn = msn;
	}

	public String getCompany()
	{
	
		return company;
	}

	public void setCompany(String company)
	{
		if(company == null)
			company = "";
	
		this.company = company;
	}

	public String getTags()
	{
	
		return tags;
	}

	public void setTags(String tags)
	{
		if(tags == null)
			tags = "";
	
		this.tags = tags;
	}

	public int getLevel()
	{
	
		return level;
	}

	public void setLevel(int level)
	{
	
		this.level = level;
	}

	public String getHeadPicture()
	{
	
		return headPicture;
	}

	public void setHeadPicture(String headPicture)
	{
	
		this.headPicture = headPicture;
	}

	public boolean isOfficial()
	{
	
		return isOfficial;
	}

	public void setOfficial(boolean isOfficial)
	{
	
		this.isOfficial = isOfficial;
	}
	
	
	
	
	
	
	
	
}
